Skip to content

Conversation

@dphuang2
Copy link
Collaborator

@dphuang2 dphuang2 commented Jan 8, 2026

Note

Introduces evaluator versioning and consolidates Fireworks SDK usage, while tightening environment handling and tests.

  • Implements evaluator versions: evaluation.create() now creates evaluator_versions, uploads code via evaluator_versions.get_upload_endpoint, validates via evaluator_versions.validate_upload, and returns (result, version_id)
  • RFT flow updated: create_rft uploads evaluator if needed and polls specific version for ACTIVE via _poll_evaluator_version_status; removes deprecated --force handling
  • Adds eval_protocol/fireworks_client.py for a unified create_fireworks_client() with support for FIREWORKS_EXTRA_HEADERS; refactors callers (evaluation, platform_api, RFT job creation) to use it
  • Hardens env loading: explicit load_dotenv paths in CLI and Vercel quickstart; .auth adds .env.dev/.env resolution helpers; removes implicit find-dotenv usage elsewhere
  • Test suite expanded/updated for versioning, client factory, and no-implicit-dotenv checks; stubs adjusted accordingly
  • Increases SQLite event bus retry/backoff thresholds for lock handling
  • Bumps dependency fireworks-ai to 1.0.0a22; minor .gitignore/.vscode housekeeping

Written by Cursor Bugbot for commit ab04086. This will update automatically on new commits. Configure here.

- Introduced a new `fireworks_client.py` module to centralize Fireworks SDK client creation.
- Updated CLI and evaluation modules to use the new `create_fireworks_client` function instead of direct instantiation of the Fireworks class.
- Enhanced handling of API key, account ID, base URL, and extra headers through environment variables.
- Added tests for the new Fireworks client factory to ensure proper functionality and configuration.
- Added functionality to load environment variables from .env.dev or .env as a fallback when the auth module is imported.
- Updated the API key verification process to allow explicit base URL handling, defaulting to dev.api.fireworks.ai if not provided.
- Removed redundant environment variable loading code from platform_api module.
- Introduced functionality to create evaluator versions using parameters such as commit hash, entry point, and requirements.
- Updated the upload endpoint call to utilize the newly created evaluator version ID instead of a hardcoded test version ID.
- Added error handling for missing evaluator version ID in the response to ensure robustness during code uploads.
update to latest once SDK is published with changes
- Implemented a try-except block to handle APIStatusError during evaluator creation.
- Added logic to check for existing evaluators and retrieve the existing one if a conflict occurs (status code 409).
- Enhanced logging for better traceability of evaluator creation process.
…d signature introspection, avoiding unnecessary API requests during help invocations.
…dating polling functions to target specific evaluator versions. Refactor related CLI commands and tests to accommodate these changes, ensuring clearer status messages and improved error handling.
if "api.fireworks.ai" in provided_base:
resolved_base = provided_base
else:
resolved_base = "https://dev.api.fireworks.ai"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verification endpoint defaults to dev for custom API bases

Medium Severity

The verify_api_key_and_get_account_id function now falls back to https://dev.api.fireworks.ai for the verification call when the API base URL doesn't contain "api.fireworks.ai". This causes authentication failures for users with custom endpoints (proxies, internal deployments) who have production API keys, since the verification request goes to dev which rejects production credentials. The fallback should likely use production (https://api.fireworks.ai) instead of dev, or the user's configured base URL should be respected.

Fix in Cursor Fix in Web

logger.warning(f"Code upload failed (evaluator created but code not uploaded): {upload_error}")
# Don't fail - evaluator is created, just code upload failed
# Return None for version_id since upload failed
return result, None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tar file not cleaned up when upload fails

Medium Severity

When the upload process fails after the tar.gz file is created at tar_path, the exception handler returns (result, None) without removing the tar file. The cleanup at lines 347-349 is only reached on the success path. This leaves a {dir_name}.tar.gz file in the user's working directory after every failed upload attempt, which could be large and confusing.

Additional Locations (1)

Fix in Cursor Fix in Web

…iable loading into local test command. Introduced functions to find and retrieve values from .env files, enhancing configuration management for Docker tests.
…iable loading into local test command. Introduced functions to find and retrieve values from .env files, enhancing configuration management for Docker tests.
- improving environment variable management and preventing conflicts with other .env files.
- improving environment variable management and preventing conflicts with other .env files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants